package com.ccrfid.rmc6.entity.poi;

import com.vividsolutions.jts.geom.Point;
import com.vividsolutions.jts.geom.Polygon;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.Type;
import org.hibernate.annotations.UpdateTimestamp;

import javax.persistence.*;
import java.sql.Timestamp;

@Entity
@Table(name = "poi_location")
public class PoiLocationEntity {
    private Long id;
    private String locationName;
    private Integer locationType;
    private Point locationCentroid;
    private Polygon locationPolygon;
    private String locationSn;
    private Integer mapLevel;
    private Integer floorNumber;
    private Long bindOrgId;
    private Timestamp createTime;
    private Timestamp updateTime;

    @Id
    @Column(name = "id", nullable = false)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Basic
    @Column(name = "location_name", nullable = false, length = 64)
    public String getLocationName() {
        return locationName;
    }

    public void setLocationName(String locationName) {
        this.locationName = locationName;
    }

    @Basic
    @Column(name = "location_type", nullable = false)
    public Integer getLocationType() {
        return locationType;
    }

    public void setLocationType(Integer locationType) {
        this.locationType = locationType;
    }

    @Basic
    @Column(name = "location_centroid", nullable = false)
    @Type(type = "jts_geometry")
    public Point getLocationCentroid() {
        return locationCentroid;
    }

    public void setLocationCentroid(Point locationCentroid) {
        this.locationCentroid = locationCentroid;
    }

    @Basic
    @Column(name = "location_polygon", nullable = false)
    @Type(type = "jts_geometry")
    public Polygon getLocationPolygon() {
        return locationPolygon;
    }

    public void setLocationPolygon(Polygon locationPolygon) {
        this.locationPolygon = locationPolygon;
    }

    @Basic
    @Column(name = "location_sn", nullable = true, length = 45)
    public String getLocationSn() {
        return locationSn;
    }

    public void setLocationSn(String locationSn) {
        this.locationSn = locationSn;
    }

    @Basic
    @Column(name = "map_level", nullable = false)
    public Integer getMapLevel() {
        return mapLevel;
    }

    public void setMapLevel(Integer mapLevel) {
        this.mapLevel = mapLevel;
    }

    @Basic
    @Column(name = "floor_number", nullable = true)
    public Integer getFloorNumber() {
        return floorNumber;
    }

    public void setFloorNumber(Integer floorNumber) {
        this.floorNumber = floorNumber;
    }

    @Basic
    @Column(name = "bind_org_id", nullable = true)
    public Long getBindOrgId() {
        return bindOrgId;
    }

    public void setBindOrgId(Long bindOrgId) {
        this.bindOrgId = bindOrgId;
    }

    @Basic
    @Column(name = "create_time", nullable = false)
    @CreationTimestamp
    public Timestamp getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }

    @Basic
    @Column(name = "update_time", nullable = false)
    @UpdateTimestamp
    public Timestamp getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Timestamp updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public String toString() {
        return "PoiLocationEntity{" +
                "id=" + id +
                ", locationName='" + locationName + '\'' +
                ", locationType=" + locationType +
                ", locationCentroid=" + locationCentroid +
                ", locationPolygon=" + locationPolygon +
                ", mapLevel=" + mapLevel +
                ", floorNumber=" + floorNumber +
                ", bindOrgId=" + bindOrgId +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                '}';
    }
}
